package com.zhr.handler;

import com.zhr.server.WeixinRequest;
import com.zhr.server.WeixinResponse;
import com.zhr.type.MsgType;

public class MessageLocationHandler extends MessageAbstractHandler {

	@Override
	public WeixinResponse handle(WeixinRequest request) {
		WeixinResponse response = super.handle(request);
		response.setMsgType(MsgType.text.name());
		String responseContent = "";
		responseContent = String.format(
				"你好，你现在位于坐标：\n纬度(%s)，\n经度(%s)，\n地图缩放大小(%s)，\n地理位置信息(%s)",
				request.getLocation_X(), request.getLocation_Y(),
				request.getScale(), request.getLabel());
		response.setContent(responseContent);
		return response;
	}

	@Override
	public int getPriority() {
		return MIN_PRIORITY;
	}

	@Override
	public boolean accpet(WeixinRequest request) {
		return true;
	}

}
